-
Notifications
You must be signed in to change notification settings - Fork 603
Fix Bicep compilation errors preventing azd up/down in AI Gallery template #400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: spboyer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot - I got this error message and when fixing it, then re-deploying it, it worked.
Error message
ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription:
Deployment Error Details:
InvalidTemplateDeployment: The template deployment failed because of policy violation. Please see details for more information.
RequestDisallowedByPolicy: Resource 'sts6kfcrkejlziy' was disallowed by policy. Reasons: 'This request was denied due to internal policy. Anonymous blob access is not allowed. For more information, refer to https://aka.ms/denyblobaccess.','This request was denied due to internal policy. Local authentication methods are not allowed. For more information, refer to https://aka.ms/safesecretsstandard.'. See error details for policy resource IDs.
Error Analysis
- Anonymous Blob Access Policy Violation
Issue: The policy blocks storage accounts that allow anonymous blob access
Resource: storage account
Policy: Organization has disabled anonymous blob access for security - Local Authentication Methods Policy Violation
Issue: The policy blocks storage accounts using access keys/connection strings
Policy: Organization requires managed identity or other secure authentication methods
Changes Applied:
- Disabled Anonymous Blob Access: Added allowBlobPublicAccess: false
- Disabled Shared Key Access: Added allowSharedKeyAccess: false
- Enabled OAuth by Default: Added defaultToOAuthAuthentication: true
- Set Container Access to None: Changed publicAccess: 'Blob' to publicAccess: 'None'
What This Means:
✅ Security Compliant: Now meets your organization's security policies
✅ Managed Identity Only: Applications will use managed identities for authentication
✅ No Public Access: Containers are private and secure
✅ Modern Authentication: Uses Azure AD OAuth instead of access keys
Will you please recheck and make changes to the PR?
@copilot can you address these errors? |
Co-authored-by: spboyer <[email protected]>
... I've fixed the Azure policy violations in the storage account configuration. The changes disable anonymous blob access, disable shared key access, enable OAuth authentication by default, and set container access to None. These changes ensure compliance with your organization's security policies. The Bicep template compiles successfully with these security-compliant settings. Commit: 0cbacc2 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@vhvb1989 @JeffreyCA can you help review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but there is no need to commit the full ARM file (main.json)
Co-authored-by: vhvb1989 <[email protected]>
The main.json file has been removed and .gitignore updated to exclude compiled Bicep outputs while preserving necessary parameter files. Commit: 7080a1e |
@vhvb1989 I think Copilot requires one more review from you here. |
This PR resolves critical Bicep compilation errors that were preventing
azd up
andazd down
from working, addressing the AI Gallery Standard Validation failures.Issues Fixed
1. Critical BCP420 Scope Resolution Error
The main blocker was in
infra/core/host/container-apps.bicep
where a conditional scope expression was too complex for compile-time resolution:2. Safe Access Operator Warnings
Replaced
contains()
function calls with modern safe access operator (.?) and null coalescing (??):storage-account.bicep:
keyvault-secrets.bicep:
cognitiveservices.bicep:
Validation Results
@secure()
)Impact
These fixes should resolve the
azd up
andazd down
failures reported in the AI Gallery Standard Validation, allowing the template to be properly deployed and torn down.Fixes #375.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms
bicep build infra/main.bicep --stdout
(dns block)curl -fsSL REDACTED
(dns block)bicep build --stdout infra/main.bicep
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.